<?php defined('SYSPATH') or die('No direct script access.');

 class Controller_Mobile_Site extends Controller{

    public function action_index(){

      $callback=$this->request->query("callback");

      $site_model=new Model_Site();

      $listinfo=$site_model->getPostList();

      $site_post=$listinfo['list'];

      $total=$listinfo['total'];

      foreach ($site_post as $key => $value) {

        $site_post[$key]['image']=Lib_Image::getPostImage($value['id'],$value['images'],260);
        
      }

      $data=array();

      $data['code']="0x00000";

      $data['list']=$site_post;

      $data['total']=$total;


      $result=json_encode($data);

       if(!empty($callback)&&$callback=="json_call"){

        exit($callback."($result)");

      }


      exit($result);

    }
 } 
